<ul class="nav nav-tabs" ng-init="checkarray(pagedata.item,'tabs')">
	<li><a href="javascript:;" ng-click="pagedata.modal('setting')">页面基本信息设置</a></li>
</ul>
<!-- 筛选-->
<div class="keyword-list-head" ng-init="checkobj(pagedata.item,'search_one')" ng-show="pagedata.item.search_type==1" ng-click="pagedata.modal('edit_search_one')">
	<div class="keyword-list-head clearfix">
		<div class="pull-right" ng-show="pagedata.item.search_one.add">
			<a href="javascript:;" class="btn btn-primary">+{{pagedata.item.search_one.add_title}}</a>
		</div>
		<div class="input-group jinyun-margin-bottom" style="width:466px;">
			<div class="input-group-btn" style="font-size:14px" ng-show="pagedata.item.search_one.select_name">
				<select  class="jinyun-select mass-group" >
					<option value="" selected="selected">{{pagedata.item.search_one.select_title}}</option>
				</select>
			</div>
			<input class="form-control" type="text" value="" placeholder="" style="width: 430px;">
			<span class="input-group-btn"><button class="btn btn-primary"><i class="fa fa-search"></i></button></span>
		</div>
	</div>
</div>
<div class="panel panel-info form-horizontal" ng-init="checkarray(pagedata.item,'search')" ng-show="pagedata.item.search_type==2">
	<div class="panel-heading">筛选</div>
	<div class="panel-body" >
		<!-- 添加按钮-->
		<div ng-repeat="seh in pagedata.item.search" ng-include="sys_html('app_develop/plugin/show_edit/edit/'+seh.type)" ></div>
		<div class="pull-left col-xs-12 col-sm-3 col-md-2 col-lg-2" ng-click="i=pagedata.item.search.push({});pagedata.edit_search(pagedata.item.search[i-1])">
			<button class="btn btn-primary"><i class="fa fa-plus"></i>添加一个筛选项</button>
		</div>
		<div class="pull-left col-xs-12 col-sm-3 col-md-2 col-lg-2">
			<button class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button>
		</div>
	</div>
</div>
<div class="clearfix table-responsive" ng-init="checkarray(pagedata.item,'list')">
	<div class="alert alert-success alert-dismissable" ng-click="pagedata.edit(pagedata.item,'tip','设置提示信息')">
		<i class="fa fa-bullhorn alert-link"></i>{{pagedata.item.tip}}
	</div>
	<table class="table jinyun-table table-hover vertical-middle jinyun-form">
		<thead class="navbar-inner">
			<tr>
				<th ng-repeat="th in pagedata.item.list" ><span ng-click="pagedata.edit_th(th)">{{th.title}}</span> <em class="jy-close" href="javascript:;" ng-click="pagedata.item.list.splice($index,1)">×</em></th>
				<th ng-click="i=pagedata.item.list.push({'title':'列名','fields':[]});pagedata.edit_th(pagedata.item.list[i-1])">添加列</th>
				<th class="text-right" style="word-break : break-all;" ng-click="pagedata.modal('edit_action')">操作</th>
			</tr>
		</thead>
			<tr ng-repeat="exp in pagedata.exps" ng-show="$index<pagedata.item.page_num" ng-click="pagedata.edit(pagedata.item,'page_num','每页显示数量','填写列表每页显示数据的条数。请填写100以内的正整数')">
				<th ng-repeat="th in pagedata.item.list"><span ng-repeat="field in th.fields">【{{field.field_name}}】</span></th>
				<th ></th>
				<td class="text-right">
					<a href="javascript:;" class="btn btn-primary">选取</a>
				</td>
			</tr>
	</table>
	<div  class="text-right" ng-show="pagedata.item.pagelist" ng-click="pagedata.modal('setting')">
		<ul class="pagination pagination-centered">
			<li><a href="javascript:;" class="pager-nav">首页</a></li>
			
			<li class="active"><a href="javascript:;" class="pager-nav">1</a></li>
			<li><a href="javascript:;" class="pager-nav">2</a></li>
			<li><a href="javascript:;" class="pager-nav">尾页</a></li>
		</ul>
	</div>
</div>
<!-- 精简型搜索框-->
<div id="floating-content-edit_search_one"  class="modal fade"  tabindex="-1" style="z-index:2000;display:none">
    <div class="jinyun-modal-dialog modal-dialog" style='width: 920px;'>
        <div class="modal-content">
            <div class="modal-header"><button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button><h3>设置搜索框样式</h3></div>
			<div class="modal-body">
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">主筛选字段</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
					<select class="form-control" ng-model="pagedata.item.search_one.name">
						<option value="" selected>请选择筛选字段</option>
						<option ng-repeat="field in pagedata.fields" ng-selected="pagedata.item.search_one.name==field.name" value="{{field.name}}" >{{field.title}}</option>
					</select>
					<div class="help-block"></div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">下拉筛选字段</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
					<select class="form-control" ng-model="pagedata.item.search_one.select_name">
						<option value="" selected>请选择筛选字段</option>
						<option ng-repeat="field in pagedata.fields" ng-selected="pagedata.item.search_one.select_name==field.name" value="{{field.name}}" >{{field.title}}</option>
					</select>
					<div class="help-block">指左侧下拉框选择对应的字段，不设置则不显示左侧下拉框</div>
				</div>
			</div>
			<div class="form-group" ng-show="pagedata.item.search_one.select_name">
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">下拉提示内容</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<input type="text" class="form-control " ng-model="pagedata.item.search_one.select_title"/>
						<div class="help-block"></div>
					</div>
			</div>
			</div>
            <div class="modal-footer"><a href="javascript:;" aria-hidden="true" data-dismiss="modal" class=" btn btn-primary">确定</a></div>
        </div>
    </div>
</div>
<!-- 页面基本参数设置-->
<div id="floating-content-setting"  class="modal fade"  tabindex="-1" style="z-index:2000;display:none">
    <div class="jinyun-modal-dialog modal-dialog" style='width: 920px;'>
        <div class="modal-content">
            <div class="modal-header"><button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button><h3>设置页面基本参数</h3></div>
			<div class="modal-body">
			<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">页面标题</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<input type="text" class="form-control " ng-model="pagedata.item.title"  />
						<div class="help-block">设置页面标题</div>
					</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">选择字段</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
					<select class="form-control" ng-model="pagedata.item.choose_field">
						<option value="" selected>请选择筛选字段</option>
						<option ng-repeat="field in pagedata.fields" ng-selected="pagedata.item.choose_field==field.name" value="{{field.name}}" >{{field.title}}</option>
					</select>
					<div class="help-block">点击选取按钮返回的数据字段</div>
				</div>
			</div>
			<div class="form-group" >
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">搜索框样式</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
					<div class="radio radio-inline" ng-repeat="(value,dtitle) in pagedata.sousuo_types">
						<label>
							<input type="radio" value="{{value}}" ng-model="pagedata.item.search_type"/>{{dtitle}}
						</label>
					</div>
					<div class="help-block"></div>
				</div>
			</div>
			<div class="form-group" >
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">是否分页显示</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<label class="left-label">
							<div ng-show="pagedata.item.pagelist" class="switch  switchOn" ng-click="pagedata.item.pagelist=false"></div>
							<div ng-show="!pagedata.item.pagelist" class="switch" ng-click="pagedata.item.pagelist=true"></div>
						</label>
						<div class="help-block"></div>
					</div>
			</div>
			<div class="form-group" ng-show="pagedata.item.pagelist">
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">每页显示数量</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<input type="text" class="form-control " ng-model="pagedata.item.page_num"  />
						<div class="help-block"></div>
					</div>
			</div>
			</div>
            <div class="modal-footer"><a href="javascript:;" aria-hidden="true" data-dismiss="modal" class=" btn btn-primary">确定</a></div>
        </div>
    </div>
</div>
<!-- 筛选项参数设置-->
<div id="floating-content-edit_search"  class="modal fade"  tabindex="-1" style="z-index:2000;display:none">
    <div class="jinyun-modal-dialog modal-dialog" style='width: 920px;'>
        <div class="modal-content">
            <div class="modal-header"><button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button><h3>设置筛选项参数</h3></div>
			<div class="modal-body">
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">选择字段</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
					<select class="form-control" ng-model="pagedata.current_search.name">
						<option value="" selected>请选择筛选字段</option>
						<option ng-repeat="field in pagedata.fields" ng-selected="pagedata.current_search.name==field.name" value="{{field.name}}" >{{field.title}}</option>
					</select>
					<div class="help-block"></div>
				</div>
			</div>
			</div>
            <div class="modal-footer"><a href="javascript:;" aria-hidden="true" data-dismiss="modal" class=" btn btn-primary">确定</a></div>
        </div>
    </div>
</div>
<!--列管理 -->
<div id="floating-content-edit_th"  class="modal fade"  tabindex="-1" style="z-index:2000;display:none">
    <div class="jinyun-modal-dialog modal-dialog" style='width: 920px;'>
        <div class="modal-content">
            <div class="modal-header"><button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button><h3>设置列参数</h3></div>
			<div class="modal-body form-horizontal">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">列名</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<input type="text" class="form-control " ng-model="pagedata.current_th.title"  />
						<div class="help-block"></div>
					</div>
				</div>
				<div class="form-group-title">
					显示项目管理
				</div>
				<div class="table-responsive" class="panel-body">
						<table class="table jinyun-table table-hover vertical-middle jinyun-form">
							<thead>
								<tr>
									
									<th>名称</th>
									<th class="text-right" style="word-break : break-all;">操作</th>
								</tr>
							</thead>
							<tbody id="re-items">
								<tr ng-repeat="field in pagedata.current_th.fields">
									
									<td>{{field.field_name}}</td>
									<td class="text-right">
										<a href="javascript:;" ng-click="pagedata.current_th.fields.splice($index,1)" title="删除此条目" class="btn btn-primary btn-sm"><i class="fa fa-times"></i></a> &nbsp;
										<a href="javascript:;" title="编辑" ng-click="pagedata.edit_th_one(field)" class="btn btn-primary btn-sm"><i class="fa fa-edit"></i></a>
									</td>
								</tr>
								<tr>
									<td colspan='3' class="text-left">
										<a class="color-gray add-new-keyword" href="javascript:;" ng-click="i=pagedata.current_th.fields.push({'type':1});pagedata.edit_th_one(pagedata.current_th.fields[i-1])">
											<span class="add-icon"><i class="fa fa-plus"></i></span>
											<span class="text">添加一项</span>
										</a>
									</td>
								</tr>
							</tbody>
						</table>
				</div>
			</div>
            <div class="modal-footer"><a href="javascript:;" aria-hidden="true" data-dismiss="modal" class=" btn btn-primary">确定</a></div>
        </div>
    </div>
</div>
<!--列显示项目参数设置-->
<div id="floating-content-edit_th_one"  class="modal fade"  tabindex="-1" style="z-index:2001;display:none">
    <div class="jinyun-modal-dialog modal-dialog" style='width: 920px;'>
        <div class="modal-content">
            <div class="modal-header"><button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button><h3>设置显示项参数</h3></div>
			<div class="modal-body">
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">选择字段</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
					<select class="form-control" ng-model="pagedata.current_th_field.field_name">
						<option value="" selected>请选择字段</option>
						<option ng-repeat="field in pagedata.fields" ng-selected="pagedata.current_search.name==field.name" value="{{field.name}}" >{{field.title}}</option>
					</select>
					<div class="help-block"></div>
				</div>
			</div>
			</div>
            <div class="modal-footer"><a href="javascript:;" aria-hidden="true" data-dismiss="modal" class=" btn btn-primary">确定</a></div>
        </div>
    </div>
</div>

<script>

scope.pagedata.edit_search=function(seh){
	scope.pagedata.current_search=seh;
	window.bootstrap('#floating-content-edit_search').modal();
}

scope.pagedata.edit_th=function(th){
	//设置列参数
	scope.pagedata.current_th=th;
	window.bootstrap('#floating-content-edit_th').modal();
}
scope.pagedata.edit_th_one=function(th_one){
	//设置列显示元素的参数
	scope.pagedata.current_th_field=th_one;
	window.bootstrap('#floating-content-edit_th_one').modal();
}
</script>